/**
 * 判断数值是否为空
 * null, undefined, '', '   ', [], {}
 * 都视为空
 * @param value
 * @returns {boolean}
 */
export const isEmpty = (value: any): boolean => {
    const type = Object.prototype.toString.call(value);
    switch (type) {
        case '[object Null]': return true;
            break;
        case '[object Undefined]': return true;
            break;
        case '[object String]': return value.trim().length === 0;
            break;
        case '[object Array]': return value.length === 0;
            break;
        case '[object Object]': return Object.keys(value).length === 0;
            break;
        default: return false;
    }
};


